import service from "@/utils/request";

export function getRoleListService(params) {
    return service({
        url: "/role/list",
        method: "get",
        params,
    });
}

export function deleteRoleService(roleId) {
    return service({
        url: `/role/${roleId}`,
        method: "delete",
    });
}

export function getRolePermissionListService(params) {
    return service({
        url: `/role/permission/${params.roleId}`,
        method: "get",
        params,
    });
}

export function addRoleService(data) {
    return service({
        url: "/role/add",
        method: "post",
        data,
    });
}

export function getAvailablePermissionListService(params) {
    return service({
        url: "/role/availablePermission",
        method: "get",
        params,
    });
}


export function removeRolePermissionService(data) {
    return service({
        url: `/role/delete/permission`,
        method: "delete",
        data
    });
}


export function addRolePermissionService(data) {
    return service({
        url: "/role/add/permission",
        method: "post",
        data  // 改为使用data传递请求体
    });
}